<template>
  <div>
    <div class="title">周末去哪儿</div>
    <ul class="items">
      <li
        class="item border-bottom"
        v-for="item of list"
        :key="item.id"
      >
        <div class="item-img-wrapper">
          <img
            :src="item.imgUrl"
            class="item-img"
          >
        </div>
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeWeekend',
  props: {
    list: Array
  },
  data () {
    return {
      recommendList: [
        {
          id: '001',
          title: '上海迪士尼乐园',
          imgUrl: 'http://img1.qunarzz.com/sight/source/1511/ea/7f43191b747bb9.jpg_r_640x214_f58e829d.jpg',
          desc: '浪漫的上海首站，浪漫的上海乐园'
        },
        {
          id: '002',
          title: '上海迪士尼乐园',
          imgUrl: 'http://img1.qunarzz.com/sight/source/1511/ea/7f43191b747bb9.jpg_r_640x214_f58e829d.jpg',
          desc: '浪漫的上海首站，浪漫的上海乐园'
        },
        {
          id: '003',
          title: '上海迪士尼乐园',
          imgUrl: 'http://img1.qunarzz.com/sight/source/1511/ea/7f43191b747bb9.jpg_r_640x214_f58e829d.jpg',
          desc: '浪漫的上海首站，浪漫的上海乐园'
        },
        {
          id: '004',
          title: '上海迪士尼乐园',
          imgUrl: 'http://img1.qunarzz.com/sight/source/1511/ea/7f43191b747bb9.jpg_r_640x214_f58e829d.jpg',
          desc: '浪漫的上海首站，浪漫的上海乐园'
        }
      ]
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl'

.title
  line-height 0.8rem
  background-color #eeeeee
  text-indent 0.2rem

.item-img-wrapper
  overflow hidden
  width 100%
  height 0
  padding-bottom 37.4375%

  .item-img
    width 100%

.item-info
  padding 0.1rem
  min-width 0 // 黑科技：保证内容不超出外层容器

.item-title
  line-height 0.54rem
  font-size 0.32rem
  ellipsis()

.item-desc
  line-height 0.4rem
  color #cccccc
  ellipsis()
</style>
